package com.liangzhong.model.lottery
{
	import flash.utils.getTimer;

	public class LotteryDataManger
	{
		private var _tiantiRanking:Object;
		private var _myRanking:Object;
		private var _friendRanking:Object;
		private var _shooterRanking:Object;
		private var _tiantiTime:int;
		private var _myTime:int;
		private var _friendTime:int;
		private var _shooterTime:int;
		
		public function LotteryDataManger()
		{
		}

		/**
		 *天梯排名 
		 */
		public function get tiantiRanking():Object
		{
			return _tiantiRanking;
		}

		/**
		 * @private
		 */
		public function set tiantiRanking(value:Object):void
		{
			_tiantiTime = getTimer();
			
			
			_tiantiRanking = value;
		}

		/**
		 * 我的排名 
		 */
		public function get myRanking():Object
		{
			return _myRanking;
		}

		/**
		 * @private
		 */
		public function set myRanking(value:Object):void
		{
			_myTime = getTimer();
			_myRanking = value;
		}

		/**
		 *好友排名 
		 */
		public function get friendRanking():Object
		{
			return _friendRanking;
		}

		/**
		 * @private
		 */
		public function set friendRanking(value:Object):void
		{
			_friendTime = getTimer();
			_friendRanking = value;
		}

		/**
		 *射手排名 
		 */
		public function get shooterRanking():Object
		{
			return _shooterRanking;
		}

		/**
		 * @private
		 */
		public function set shooterRanking(value:Object):void
		{
			_shooterTime = getTimer();
			_shooterRanking = value;
		}

		/**
		 *天梯请求数据时间 
		 */
		public function get tiantiTime():int
		{
			return (getTimer() - _tiantiTime) / 1000;
		}

		/**
		 * @private
		 */
		public function set tiantiTime(value:int):void
		{
			_tiantiTime = value;
		}

		/**
		 *我的 数据时间
		 */
		public function get myTime():int
		{
			return (getTimer() - _myTime) / 1000
		}

		/**
		 * @private
		 */
		public function set myTime(value:int):void
		{
			_myTime = value;
		}

		/**
		 *好友数据时间 
		 */
		public function get friendTime():int
		{
			return (getTimer() - _friendTime) / 1000
		}

		/**
		 * @private
		 */
		public function set friendTime(value:int):void
		{
			_friendTime = value;
		}

		/**
		 *射手时间 
		 */
		public function get shooterTime():int
		{
			return (getTimer() - _shooterTime) / 1000
		}

		/**
		 * @private
		 */
		public function set shooterTime(value:int):void
		{
			_shooterTime = value;
		}


		/**
		 * 获得数据 
		 * @param $obj
		 * 
		 */
		public function getdata($obj:Object):void
		{
			switch($obj.type)
			{
				case 1:
					tiantiRanking = $obj;
					break;
				case 2:
					myRanking = $obj;
					break;
				case 3:
					friendRanking = $obj;
					break;
				case 4:
					shooterRanking= $obj;
					break;
			}
		}
	}
}